#include "rendRegister.hpp"
#include "rendAttrBuffer.hpp"

#if	defined(GL_USE_MAPBUFFER)
#include "rendAttrBufferMapped.hpp"
#endif

#include "rendMaterial.hpp"

namespace rend {
namespace naked {

template<>
class Register< std::string, AttrBuffer< 16 > >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, AttrBuffer< 16 > >::Storage*
	Register< std::string, AttrBuffer< 16 > >::s_storage;


#if	defined(GL_USE_MAPBUFFER)

template<>
class Register< std::string, AttrBufferMapped< 16 > >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, AttrBufferMapped< 16 > >::Storage*
	Register< std::string, AttrBufferMapped< 16 > >::s_storage;

#endif // GL_USE_MAPBUFFER

template<>
class Register< std::string, Material::Texture >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::Texture >::Storage*
	Register< std::string, Material::Texture >::s_storage;


template<>
class Register< std::string, Material::Program >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::Program >::Storage*
	Register< std::string, Material::Program >::s_storage;


template<>
class Register< std::string, Material::LinkedProgram >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::LinkedProgram >::Storage*
	Register< std::string, Material::LinkedProgram >::s_storage;


template<>
class Register< std::string, Material::EnvMat4 >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::EnvMat4 >::Storage*
	Register< std::string, Material::EnvMat4 >::s_storage;


template<>
class Register< std::string, Material::EnvMat4v >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::EnvMat4v >::Storage*
	Register< std::string, Material::EnvMat4v >::s_storage;


template<>
class Register< std::string, Material::EnvVec4 >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::EnvVec4 >::Storage*
	Register< std::string, Material::EnvVec4 >::s_storage;


template<>
class Register< std::string, Material::EnvVec4v >
{
	static struct Storage {
		void*	 bits;
		unsigned capacity;
		unsigned size;
	} *s_storage;
};

Register< std::string, Material::EnvVec4v >::Storage*
	Register< std::string, Material::EnvVec4v >::s_storage;

} // namespace naked
} // namespace rend

